<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${_ctx}">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台首页</title>
<link rel="stylesheet" type="text/css" href="css/htgongxiang.css"/>
		<script src="js/jquery-2.2.3.min.js"></script>
		<script src="js/leftshoufengqing.js"></script>
		<script type="text/javascript">
			$(function(){
				    setInterval('getTips()', 3000)  
				 
			})
			 function getTips(){
				var oldcount=$(".allcount").text();
				$.ajax({
					type:"post",
					url:"htmain?v=neworder",
					success:function(msg){
						var jsonarr=$.parseJSON(msg);
						console.log(jsonarr);
						console.log(jsonarr.tiplist[0].fztime);
						if(jsonarr.allcount>oldcount){
							$(".allcount").text(jsonarr.allcount);
							$(".tips").remove();
							console.log($(".tips"));
				
							var $ul=$(".extended")
							jsonarr.tiplist.forEach(function(v,i){
								
								var $li=$("<li>");
								$ul.append($li);
								$li.addClass("tips");
								$li.html("<a><img src='imgs/htimgs/touxiang.png' />"+v.oruser+" &nbsp;&nbsp; 的新订单"
								+"<span class='small italic'>"+v.fztime+"分钟前</span></a>");
							})
							$ul.slideToggle(200);
						}
					}
				})
			}
		</script>
	</head>
	<body style="overflow-x: hidden;">
		<div id="htbox">
			<header class="main-header">
				<div class="logo">
					<span class="logo-lg">
						<b>iWebShop</b>
						后台管理
					</span>
				</div>
				<div class="navbar">
					<a class="sidebar-toggle">
						
					</a>
					<div id="menu">
						<ul class="nav">
							<li>
								<a class="dropdown-toggle">
									<img src="imgs/htimgs/lingdang.png" />
									<span class="badge bg-warning allcount">${allcount}</span>
								</a>
								<ul class="dropdown-menu extended">
									<div class="notify-arrow notify-arrow-yellow"></div>
									<li>
										<p class="yellow">前<span>3</span>条未处理的信息</p>
									</li>
									<c:forEach var="c" items="${tiplist}">
									<li class="tips">
										<a target="frm" href="htmain?v=htorderxq&orid=${c.orid}" style="color:#555">
											<img src="imgs/htimgs/touxiang.png" />
											${c.oruser} &nbsp;&nbsp; 的新订单
											<span class="small italic">${c.fztime} 分钟前</span>
										</a>
									</li>
									</c:forEach>
								</ul>
							</li>
							<li>
								<a target="frm" href="htmain?v=shouye">首页</a>
							</li>
							<li>
								<a target="frm" href="htmain?v=lunbopage">幻灯片</a>
							</li>
						</ul>
					</div>
				</div>
			</header>
			<div id="admin-left">
				<div class="user-panel">
					<div class="left image">
						<img src="imgs/htimgs/userimg.png" />
					</div>
					<div class="left info">
						<p>admin</p>
						<a>超级管理员</a>
					</div>
				</div>
				<ul class="tree">
					<li class="header">系统模块菜单</li>
					<li class="treeview">
						<a class="onea">
							<img src="imgs/htimgs/shouye.png" />
							<span>商品管理</span>
							<img src="imgs/htimgs/zuojt.png" class="right" />
						</a>
						<ul class="treeview-menu">
							<li>
								<a target="frm" href="htmain?v=splist">
									<img src="imgs/htimgs/shouye.png" />
									商品列表
								</a>
							</li>
							<li>
								<a target="frm" href="htmain?v=addcomm">
									<img src="imgs/htimgs/shouye.png" />
									添加商品
								</a>
							</li>
							<li>
								<a target="frm" href="htmain?v=typelist">
									<img src="imgs/htimgs/shouye.png" />
									商品分类列表
								</a>
							</li>
						</ul>
					</li>
					
					<li class="treeview">
						<a class="onea">
							<img src="imgs/htimgs/shouye.png" />
							<span>订单管理</span>
							<img src="imgs/htimgs/zuojt.png" class="right" />
						</a>
						<ul class="treeview-menu">
							<li>
								<a target="frm" href="htmain?v=htorder">
									<img src="imgs/htimgs/shouye.png" />
									订单列表
								</a>
							</li>
						</ul>
					</li>
				</ul>
			</div>
			<div id="admin-right">
				<iframe name="frm" allowtransparency="yes" class="rightheight"
				width="100%" src="htmain?v=shouye"></iframe>
			</div>
		</div>
</html>